package org.ant.gui.menu;

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;

import org.ant.gui.actionListeners.AboutActionListener;
import org.ant.gui.actionListeners.HelpActionListener;

public class HelpMenu extends JMenu {
	
	public static final String NAME = "Help";
	public static final String ITEM_HELP = "Help";
	public static final String ITEM_ABOUT = "About";
	
	private JMenuItem helpItem;
	private JMenuItem aboutItem;
	
	public HelpMenu(){
		super();
		setText(NAME);
		add(getHelpItem());
		add(getAboutItem());
	}

	public JMenuItem getHelpItem() {
		if(helpItem == null){
			helpItem = new JMenuItem();
			helpItem.setText(ITEM_HELP);
			Icon icon = new ImageIcon("icon/help.gif");
			helpItem.setIcon(icon);
			helpItem.addActionListener(new HelpActionListener());
		}
		return helpItem;
	}

	public JMenuItem getAboutItem() {
		if(aboutItem == null){
			aboutItem = new JMenuItem();
			aboutItem.setText(ITEM_ABOUT);
			Icon icon = new ImageIcon("icon/about.gif");
			aboutItem.setIcon(icon);
			aboutItem.addActionListener(new AboutActionListener());
		}
		return aboutItem;
	}
	
}
